import { Body, Get, Inject, Post, Provide } from '@midwayjs/decorator';
import { CoolController, BaseController } from '@cool-midway/core';
import { BusinessProductBListEntity } from '../../../../entity/product/b_list';
import { BusinessProductBStartService } from '../../../../service/product/b_start';

/**
 * 用户
 */
@Provide()
@CoolController({
  api: ['info'],
  entity: BusinessProductBListEntity,
  service: BusinessProductBStartService,
})
export class BusinessAppProductBStartController extends BaseController {
  @Inject()
  businessProductBStartService: BusinessProductBStartService;
  /**
   * 测试
   */
  @Get('/test', { summary: '测试' })
  async test() {
    return this.ok('测试成功');
  }
  /**
   * 开始录入
   */
  @Post('/enter', { summary: '开始录入' })
  async enter(@Body() body) {
    const result = await this.businessProductBStartService.enter(body);
    return this.ok(result);
  }
  /**
   * 更新打印状态
   */
  @Post('/updatePrintStatus', { summary: '更新打印状态' })
  async updatePrintStatus(
    @Body('ids') ids: [],
    @Body('status') status: Number
  ) {
    const result = await this.businessProductBStartService.updatePrintStatus(ids, status);
    return this.ok(result);
  }
}
